package com.econ.powercloud.ems.common.enums;

/**
 * 电压等级枚举
 */
public enum VoltageLevel implements EnumMethod {

    ALL(0,"全部"),
    UNDER_ONE(1,"不满1千伏"),
    TEN_TO_TWENTY(2,"10(20)千伏"),
    UP_THIRTY_FIVE(3,"35kV及以上"),
    UNDER_ONE_HUNDRED_AND_TEN(4,"35-110kV"),
    UP_TWO_HUNDRED_AND_TWENTY(5,"220kV及以上")
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    VoltageLevel(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getDescFromCode(int code){
        for(VoltageLevel type: VoltageLevel.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
